package GoodsActivityService

import (
	"context"
	"gdshop-back-end-go/client-api/app/response/GoodsResp"
)

// GetGoodsActivityTagByGoodsId 根据商品ID获取活动标签
func GetGoodsActivityTagByGoodsId(ctx context.Context, goodsId int) ([]*GoodsResp.ActivityTagItem, error) {
	gaList, err := GetGoodsActivityByGoodsId(ctx, goodsId)
	if err != nil {
		return nil, err
	}
	jieguo := []*GoodsResp.ActivityTagItem{}
	for _, item := range gaList {
		jieguo = append(jieguo, &GoodsResp.ActivityTagItem{
			Id:     item.Id,
			Type:   GetActivityTagTypeStr(item),
			Remark: item.Remark,
		})
	}
	return jieguo, nil
}
